package com.example.workbook.controller;

import com.example.workbook.common.R;
import com.example.workbook.model.request.AdminRequest;
import com.example.workbook.service.AdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpSession;

@RestController
@RequestMapping("/admin")
public class AdminController {
    @Autowired
    private AdminService adminService;

    /**
     * 判断登录是否成功
     * @param adminRequest
     * @param httpSession
     * @return
     */
    @PostMapping("/login/status")
    public R loginStatus(@RequestBody AdminRequest adminRequest, HttpSession httpSession) {
        return adminService.verityPassword(adminRequest,httpSession);
    }
}
